<template>
  <div class="home-container">
    <header class="home-header">
      <union-head :leftText="leftText" :leftIcon="leftIcon" :content="title" :rightIcon="rightIcon"></union-head>
    </header>
    <div class="home-main">
      <div id="swipe">
        <union-search :showScan="true" :isReadOnly="true" @goTo="goTo" @scan="scan"></union-search>
        <home-swipe></home-swipe>
      </div>
      <div id="life" style="height: 130px">
        <home-life></home-life>
      </div>
      <div id="activity">
        <home-activity></home-activity>
      </div>
      <div id="discount" style="margin-top: 20px;">
        <home-discount></home-discount>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import UnionHead from '../../components/union-head.vue'
  import HomeSwipe from './home-swipe.vue'
  import HomeActivity from './home-activity.vue'
  import HomeDiscount from './home-discount.vue'
  import HomeLife from './home-life.vue'
  import UnionSearch from '../../components/union-search.vue'

  export default {
    name: 'home',
    components: {
      UnionHead,
      HomeSwipe,
      HomeActivity,
      HomeDiscount,
      HomeLife,
      UnionSearch
    },
    data () {
      return {
        leftIcon: 'icon-ali-subscript',
        rightIcon: 'icon-ali-my',
        title: 'app',
        leftText: '上海',
        dataList: ''
      }
    },
    mounted () {
    },
    methods: {
      goTo () {
        this.$router.push({name: 'search'})
      },
      scan () {
        alert('正在扫描！')
      }
    }
  }
</script>

<style lang="stylus" type="text/stylus" scoped>
@import "home.styl"
</style>
